<template>
  <div>
    <fm-generate-form
      ref="generateForm"
      :data="jsonData"
      :remote="remoteList"
    />
    <el-button
      type="primary"
      @click="handleSubmit"
    >
      Submit
    </el-button>
  </div>
</template>
<script>
import { getDeptTree } from '../server'
export default {
  data () {
    return {
      remoteList:{
        'getDeptTree':getDeptTree
      },
      jsonData: {'list':[{'type':'grid','icon':'icon-grid-','columns':[{'span':8,'list':[{'type':'radio','icon':'icon-radio-active','options':{'inline':false,'defaultValue':'','showLabel':false,'options':[{'value':'其它','label':'其它'},{'value':'车间','label':'车间'}],'required':false,'width':'','remote':true,'remoteOptions':[{'value':'其它','label':'其它'},{'value':'车间','label':'车间'}],'props':{'value':'value','label':'label'},'remoteFunc':'func_1589513940000_96174','disabled':false},'name':'单选框组','key':'1589513940000_96174','model':'radio_1589513940000_96174','rules':[]}]},{'span':8,'list':[{'type':'checkbox','icon':'icon-check-box','options':{'inline':false,'defaultValue':[],'showLabel':false,'options':[{'value':'日','label':'日'},{'value':'周','label':'周'},{'value':'月','label':'月'},{'value':'半年','label':'半年'},{'value':'季度','label':'季度'},{'value':'年','label':'年'}],'required':false,'width':'','remote':true,'remoteOptions':[{'value':'日','label':'日'},{'value':'周','label':'周'},{'value':'月','label':'月'},{'value':'半年','label':'半年'},{'value':'季度','label':'季度'},{'value':'年','label':'年'}],'props':{'value':'value','label':'label'},'remoteFunc':'func_1589513948000_62358','disabled':false},'name':'多选框组','key':'1589513948000_62358','model':'checkbox_1589513948000_62358','rules':[]}]},{'span':8,'list':[{'type':'select','icon':'icon-select','options':{'defaultValue':'','multiple':false,'disabled':false,'clearable':false,'placeholder':'','required':false,'showLabel':false,'width':'','options':[{'value':'日','label':'日'},{'value':'周','label':'周'},{'value':'月','label':'月'},{'value':'季度','label':'季度'},{'value':'半年','label':'半年'},{'value':'年','label':'年'},{'value':'十年','label':'十年'}],'remote':true,'filterable':false,'remoteOptions':[{'value':'日','label':'日'},{'value':'周','label':'周'},{'value':'月','label':'月'},{'value':'季度','label':'季度'},{'value':'半年','label':'半年'},{'value':'年','label':'年'},{'value':'十年','label':'十年'}],'props':{'value':'value','label':'label'},'remoteFunc':'func_1589513951000_81710'},'name':'下拉选择框','key':'1589513951000_81710','model':'select_1589513951000_81710','rules':[]}]}],'options':{'gutter':0,'justify':'start','align':'top','remoteFunc':'func_1589513930000_71574'},'name':'栅格布局','key':'1589513930000_71574','model':'grid_1589513930000_71574','rules':[]},{'type':'grid','icon':'icon-grid-','columns':[{'span':6,'list':[{'type':'cascader','icon':'icon-jilianxuanze','options':{'defaultValue':[],'width':'','placeholder':'','disabled':false,'clearable':false,'remote':true,'remoteOptions':[],'props':{'value':'id','label':'departName','children':'list'},'remoteFunc':'getDeptTree','options':[]},'name':'级联选择器','key':'1589514084000_9577','model':'cascader_1589514084000_9577','rules':[]}]},{'span':6,'list':[]},{'span':6,'list':[]},{'span':6,'list':[]}],'options':{'gutter':0,'justify':'start','align':'top','remoteFunc':'func_1589514075000_37413'},'name':'栅格布局','key':'1589514075000_37413','model':'grid_1589514075000_37413','rules':[]}],'config':{'labelWidth':100,'labelPosition':'right','tableName':'','size':'mini'}}
    }
  },
  methods: {
    handleSubmit () {
      this.$refs.generateForm.getData().then(data => {
        alert(JSON.stringify(data))
      }).catch(e => {
      })
    }
  }
}
</script>
